package march.firstmarch21.march02;

import org.apache.hadoop.io.WritableComparable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class CallBean implements WritableComparable<CallBean> {
    private String phone;
    private String callLen = "0";
    private String callTime = "0";
    private String acceptLen = "0";
    private String acceptTime = "0";
    private String flag;

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    @Override
    public String toString() {
        return phone +","+callLen+"秒,"+callTime+"次,"+acceptLen+"秒,"+acceptTime+"次";
    }

    public CallBean() {
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCallLen() {
        return callLen;
    }

    public void setCallLen(String callLen) {
        this.callLen = callLen;
    }

    public String getCallTime() {
        return callTime;
    }

    public void setCallTime(String callTime) {
        this.callTime = callTime;
    }

    public String getAcceptLen() {
        return acceptLen;
    }

    public void setAcceptLen(String acceptLen) {
        this.acceptLen = acceptLen;
    }

    public String getAcceptTime() {
        return acceptTime;
    }

    public void setAcceptTime(String acceptTime) {
        this.acceptTime = acceptTime;
    }

    @Override
    public int compareTo(CallBean o) {
        return 0;
    }

    @Override
    public void write(DataOutput out) throws IOException {
        out.writeUTF(phone);
        out.writeUTF(callLen);
        out.writeUTF(callTime);
        out.writeUTF(acceptLen);
        out.writeUTF(acceptTime);
        out.writeUTF(flag);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        phone = in.readUTF();
        callLen = in.readUTF();
        callTime = in.readUTF();
        acceptLen = in.readUTF();
        acceptTime = in.readUTF();
        flag = in.readUTF();

    }

}
